'''
Created on Jan 17, 2010

@author: roman

$Id: cron.py 27 2010-01-24 20:30:38Z sigizmund@gmail.com $
'''

import logging
import feedreader
from google.appengine.api import users 
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util


class CronJob(webapp.RequestHandler):
    def get(self):
        logging.info("Running routine cron job...")
        try:
            feedreader.readFeed()
        except Exception, e:
            logging.error(e)


def main():
    logging.getLogger().setLevel(logging.DEBUG)
    application = webapp.WSGIApplication([ 
                                          ('/cron', CronJob)
                                          ], debug=True)
    util.run_wsgi_app(application)


if __name__ == '__main__':
    main()
                                                          